package com.inno.game.service;

import org.springframework.stereotype.Repository;

import com.inno.game.bean.User;
import com.inno.game.util.Result;

@Repository("UserService")
public class UserService {

	public Result register(User user) {
		if (user.getP().equals(user.getPc())) {
			return Result.Register_Success;
		}
		return Result.Register_Passord_Not_Equal;
	}

	public Result login(User user) {
		if ("admin".equals(user.getN()) && "123456".equals(user.getP())) {
			user.setLogedin(true);
			return Result.Login_Success;
		}
		return Result.Login_Failed;
	}
	public Result logout(User user) {
		user.setLogedin(false);
		return Result.Logout_Success;
	}
}
